//
//  showImageViewController.m
//  testCocoPods1.0
//
//  Created by ChenJs92 on 16/11/16.
//  Copyright © 2016年 chenjs92. All rights reserved.
//

#import "showImageViewController.h"
#import "MVShowImageViewModel.h"
#import "showImageView.h"
#import "AppDelegate.h"
@interface showImageViewController ()
@property (strong, nonatomic) showImageView *mainView;
@property (strong, nonatomic) MVShowImageViewModel *viewModel;
@end

@implementation showImageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)updateViewConstraints{
    //    WS(weakSelf)
    [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
        //        make.edges.mas_equalTo(weakSelf.view);
        make.left.top.right.bottom.mas_equalTo(0);
        
    }];
    [super updateViewConstraints];
}

-(void)yd_addSubviews{
    [self.view addSubview:self.mainView];
}

-(void)yd_layoutNavigation{
    
    self.title = @"show Image";
}
-(void)yd_bindViewModel{
    //绑定VM事件
    [[self.viewModel.showOrHidenNavBarSubject takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id x) {
        NSLog(@"点击了屏幕");
        BOOL hidNavBool = self.navigationController.navigationBar.hidden;
        [self hideNavigationBar:!hidNavBool animated:YES];
    }];
}
-(showImageView *)mainView{
    if (!_mainView) {
        _mainView = [[showImageView alloc] initWithViewModel:self.viewModel];
    }
    return _mainView;
}
-(MVShowImageViewModel *)viewModel{
    if (!_viewModel) {
        _viewModel = [[MVShowImageViewModel alloc] init];
    }
    return _viewModel;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
